package cn.cjp.day03;

@SuppressWarnings("ALL")
public class Studentstatic {

    private String name;
    private int age;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public Studentstatic(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public Studentstatic(String name) {
        this.name = name;
    }

    public Studentstatic(int age) {
        this.age = age;
    }

    public Studentstatic() {
    }

    static String room;

    //没有static只能通过创建对象才能使用
    @SuppressWarnings("AlibabaLowerCamelCaseVariableNaming")
    public void SayHello1(){
        System.out.println(1);
    }

    //有static也可以通过对象，也可以直接通过类名调用
    @SuppressWarnings("AlibabaLowerCamelCaseVariableNaming")
    public static void SayHello2(){
        System.out.println(2);
    }

    //静态代码块   用到该类时只会使用唯一一次
    static{
        System.out.println("用过一次此类了");
    }

}
